<%-- 
    Document   : AddHostel
    Created on : Apr 1, 2014, 4:16:10 PM
    Author     : mishra
--%>


<%@page import="User.UserBean"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Vector"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    try {
        if (session.getAttribute("uid") != null) {
            if (session.getAttribute("Manage_Hostel").toString().equals("1")) {
%>
<%String to = "", status = "", msg = "", admissionId = "";%>
<!DOCTYPE html>
<html>
    <head>
        <title>Ramgovind Automated System</title>

        <link rel="stylesheet" href="/RIT/css/bootstrap.css">
        <link rel="stylesheet" href="/RIT/css/bootstrap-responsive.css">
        <link rel="stylesheet" href="/RIT/css/jquery.fancybox.css">
        <link rel="stylesheet" href="/RIT/css/style.css">
        <link rel="stylesheet" href="/RIT/css/iconfont.css">
        <link rel="stylesheet" href="/RIT/css/bootstrap.datepicker.css">
        <script src="../../ajax/ajax.js"></script>
        
    </head>
    <body>
        <%@include file="/topheader.html" %>
        <%@include file="/settingheader.html" %>
        <div class="main">
            <div class="container-fluid">
                <%@include file="/Settings/dbsidenav.html" %>
                <div class="content">
                    <%if (session.getAttribute("status") != null) {
                            status = session.getAttribute("status").toString();
                            msg = session.getAttribute("msg").toString();
                    %>
                    <div class="alert alert-info alert-block">
                        <a class="close" data-dismiss="alert" href="#"><img src="/RIT/img/mclose.png"></a>
                        <h4 class="alert-heading"> <%=status%></h4>
                        <%=msg%>

                    </div>
                    <%session.removeAttribute("status");
                            session.removeAttribute("msg");
                        }%>
                    <div class="row-fluid">
                        <div class="span12">
                            <div class="box">
                                <div class="box-head">
                                    <h3>Submit Hostel</h3>
                                    <a href="/RIT/Settings/Database/Hostel.jsp">
                                        <button style="float: right" class="btn btn-success">View Hostel</button>
                                    </a>
                                </div>

                                <form action="/RIT/Hostel" method="post" class='validate form-horizontal'>
                                    <div class="box-content">
                                        <!---Form Start....-->
                                        <legend>
                                            Hostel Details
                                        </legend>
                                        <div id="lside" style="float: left; margin-top: 10px; width: 48%;">
                                            <div class="control-group">
                                                <label for="hname" class="control-label">Hostel Name<span style="color:red">*</span></label>
                                                <div class="controls">
                                                    <input type="text" name="hname" id="hname" class='required'>
                                                </div>
                                            </div>
                                            
                                            <div class="control-group">
                                                <label for="wardenname" class="control-label">Warden Name<span style="color:red">*</span></label>
                                                <div class="controls">
                                                    <div class="input-append">
                                                        <select id="warden" name="warden" class='required'>
                                                            <option value="">Select Warden Name</option>
                                                            <%{
                                                                Vector<Object> list=User.Query.viewAll();
                                                                Iterator it=list.iterator();
                                                                
                                                                while(it.hasNext()){
                                                                    UserBean ub=(UserBean)it.next();
                                                                    if(!ub.getUserType().equals("admin"))
                                                                    {
                                                              %>
                                                              <option value="<%=ub.getUserId()%>"><%=ub.getEmployeeName()%></option>
                                                                  
                                                            <%}}}%>
                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                            
                                            
                                            <div class="control-group">
                                                <label for="phone" class="control-label">Phone Number <span style="color:red">*</span></label>
                                                <div class="controls">
                                                    <input type="text" name="phone" id="phone" class='required'>
                                                </div>
                                            </div>
                                        </div>
                                        <div id="rside" style="float: left; margin-right: 0px; margin-top: 10px">
                                            <div class="control-group">
                                                <label for="htype" class="control-label">Hostel Type<span style="color:red">*</span></label>
                                                <div class="controls">
                                                    <select name="htype" id="htype" class='required'>
                                                        <option value="">Select Hostel Type</option>
                                                        <option value="Boys">Boys</option>
                                                        <option value="Girls">Girls</option>
                                                        <option value="Both">Both</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="control-group">
                                                <label for="mobile" class="control-label">Mobile Number<span style="color:red">*</span></label>
                                                <div class="controls">
                                                    <div class="input-append">
                                                        <input type="text" name="mobile" id="mobile" class='required'>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="control-group">
                                                <label for="mobile" class="control-label">Address<span style="color:red">*</span></label>
                                                <div class="controls">
                                                    <div class="input-append">
                                                        <textarea id="hadd" name="hadd" class='required'></textarea>
                                                    </div>
                                                </div>
                                            </div>
                                            
                                        </div>
                                        <!---Form Ends....-->
                                    </div>
                                    <div class="form-actions">
                                        <input type="submit" class='btn btn-primary'>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>

                </div>	
            </div>
        </div>

        <script src="/RIT/js/jquery.js"></script>
        <script src="/RIT/js/less.js"></script>
        <script src="/RIT/js/bootstrap.min.js"></script>
        <script src="/RIT/js/jquery.uniform.min.js"></script>
        <script src="/RIT/js/bootstrap.timepicker.js"></script>
        <script src="/RIT/js/bootstrap.datepicker.js"></script>
        <script src="/RIT/js/chosen.jquery.min.js"></script>
        <script src="/RIT/js/jquery.fancybox.js"></script>
        <script src="/RIT/js/plupload/plupload.full.js"></script>
        <script src="/RIT/js/plupload/jquery.plupload.queue/jquery.plupload.queue.js"></script>
        <script src="/RIT/js/jquery.cleditor.min.js"></script>
        <script src="/RIT/js/jquery.inputmask.min.js"></script>
        <script src="/RIT/js/jquery.tagsinput.min.js"></script>
        <script src="/RIT/js/jquery.mousewheel.js"></script>
        <script src="/RIT/js/jquery.textareaCounter.plugin.js"></script>
        <script src="/RIT/js/ui.spinner.js"></script>
        <script src="/RIT/js/jquery.jgrowl_minimized.js"></script>
        <script src="/RIT/js/jquery.form.js"></script>
        <script src="/RIT/js/jquery.validate.min.js"></script>
        <script src="/RIT/js/bbq.js"></script>
        <script src="/RIT/js/jquery-ui-1.8.22.custom.min.js"></script>
        <script src="/RIT/js/jquery.form.wizard-min.js"></script>
        <script src="/RIT/js/jquery.cookie.js"></script>
        <script src="/RIT/js/jquery.metadata.js"></script>
        <script src="/RIT/js/custom.js"></script><script src="/RIT/js/demo.js"></script>
        <script src="/RIT/js/iconfont.js"></script>
    </body>
</html>
<%
} else {
    out.println("<script>alert('" + session.getAttribute("Enquiry") + "')</script>");
%>
<script type="text/javascript">
    alert("You Are Not Authorised");
    window.history.back();
</script>
<%
            }
        } else {
            request.setAttribute("msg", "You Are Not Authorised! Please Contact to System Administrator!");
            request.setAttribute("value", "0");
            getServletContext().getRequestDispatcher("/index.jsp").forward(request, response);
        }
    } catch (Exception e) {
        request.setAttribute("msg", "Please Contact to System Administrator!");
        request.setAttribute("value", "0");
        getServletContext().getRequestDispatcher("/index.jsp").forward(request, response);
    }
%>
